Skip to content

fix(archiver): clear the waitForSpace timeout on the success path - #89

Merged
dylanjeffers merged 1 commit into
mainfrom
fix/archiver-spacemanager-timer
Aug 10, 2026
Merged

fix(archiver): clear the waitForSpace timeout on the success path#89
dylanjeffers merged 1 commit into
mainfrom
fix/archiver-spacemanager-timer

Conversation

@dylanjeffers

Copy link
Copy Markdown
Contributor

Small follow-up to #88.

waitForSpace never cleared its timeout timer, so every satisfied space claim left a pending timer alive for the full maxDiskSpaceWaitSeconds.

The late fire is harmless on its own — Promise.race has already settled and both branches are handled, so there's no unhandled rejection — but this is a long-lived worker and #88 is specifically about not leaking per-job resources. Clearing it in a finally covers both the success and failure paths.

Found while reviewing #88 against the live prod wedge (all 5 worker slots held 2.3–8.5 days, 21 jobs backed up in wait).

npx tsc --noEmit clean; all 31 archiver tests pass.

🤖 Generated with Claude Code

Follow-up to #88. `waitForSpace` never cleared its timeout timer, so every
satisfied space claim left a pending timer alive for the full
`maxDiskSpaceWaitSeconds`. The late fire is harmless on its own — `Promise.race`
has already settled and both branches are handled, so there's no unhandled
rejection — but this is a long-lived worker and #88 is specifically about not
leaking per-job resources.

Clear it in a `finally` so both the success and failure paths release the timer.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@dylanjeffers
dylanjeffers merged commit 9039448 into main Aug 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant